#pragma once

#include <iostream>
#include <SFML\Network.hpp>

#include "Packet.h"
#include "loaderConfig.h"
#include "ServerException.h"
#include "WinThread.h"
#include "GameLoop.h"
#include "DataBase.h"
#include "TypePlayer.h"

class ServerLogic
{
public:
	ServerLogic(void);
	~ServerLogic(void);

	void start();
	void receivePackage(sf::TcpSocket *);

private:
	void closeDebug();
	void exitMessageBox(ServerException &);
	void inputServer();

	void openAcceptLoop();
	void openSendLoop();
	
	void closeAcceptLoop();
	void closeSendLoop();
	void closeGameLoop();

	

	WinThread		m_loopAccept;
	WinThread		m_loopSend;
};
